From e5c0d3be0d16ec4ccbb45d53db72aaed30b53abd Mon Sep 17 00:00:00 2001 From: "akw27@arcadians.cl.cam.ac.uk" Date: Sun, 21 Aug 2005 12:24:21 +0000 Subject: [PATCH] Remove dead code from blkback. Signed-off-by: Andrew Warfield --- .../drivers/xen/blkback/common.h | 2 +- .../drivers/xen/blkback/interface.c | 47 ------------------- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h index ffb44a78d6..dd56fdeb25 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h @@ -53,7 +53,7 @@ typedef struct blkif_st { rb_root_t vbd_rb; /* Mapping from 16-bit vdevices to VBDs.*/ spinlock_t vbd_lock; /* Protects VBD mapping. */ /* Private fields. */ - enum { DISCONNECTED, DISCONNECTING, CONNECTED } status; + enum { DISCONNECTED, CONNECTED } status; /* * DISCONNECT response is deferred until pending requests are ack'ed. * We therefore need to store the id from the original request. diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c index a29fe2d6ee..259b65c39c 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c @@ -7,7 +7,6 @@ */ #include "common.h" -#include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) @@ -138,52 +137,6 @@ int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn) return 0; } -static void __blkif_disconnect_complete(void *arg) -{ - blkif_t *blkif = (blkif_t *)arg; - ctrl_msg_t cmsg; - blkif_be_disconnect_t disc; - - /* - * These can't be done in blkif_disconnect() because at that point there - * may be outstanding requests at the disc whose asynchronous responses - * must still be notified to the remote driver. - */ - unmap_frontend_page(blkif); - vfree(blkif->blk_ring.sring); - - /* Construct the deferred response message. */ - cmsg.type = CMSG_BLKIF_BE; - cmsg.subtype = CMSG_BLKIF_BE_DISCONNECT; - cmsg.id = blkif->disconnect_rspid; - cmsg.length = sizeof(blkif_be_disconnect_t); - disc.domid = blkif->domid; - disc.blkif_handle = blkif->handle; - disc.status = BLKIF_BE_STATUS_OKAY; - memcpy(cmsg.msg, &disc, sizeof(disc)); - - /* - * Make sure message is constructed /before/ status change, because - * after the status change the 'blkif' structure could be deallocated at - * any time. Also make sure we send the response /after/ status change, - * as otherwise a subsequent CONNECT request could spuriously fail if - * another CPU doesn't see the status change yet. - */ - mb(); - BUG_ON(blkif->status != DISCONNECTING); - blkif->status = DISCONNECTED; - mb(); - - /* Send the successful response. */ - ctrl_if_send_response(&cmsg); -} - -void blkif_disconnect_complete(blkif_t *blkif) -{ - INIT_WORK(&blkif->work, __blkif_disconnect_complete, (void *)blkif); - schedule_work(&blkif->work); -} - void free_blkif(blkif_t *blkif) { blkif_t **pblkif; -- 2.30.2